]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Animate opacity changes of the panel corner
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 11 Feb 2019 22:05:31 +0000 (23:05 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 13 Jan 2021 23:06:48 +0000 (23:06 +0000)
This is a requirement for fading the transparent panel in and out
smoothly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1397>

data/theme/gnome-shell-sass/widgets/_panel.scss
js/ui/panel.js

index 9c41c153b5299d611d4ae72afc850cc308b27931..5734ab10fbeb79e9f4295506e3e0b737ec51adc6 100644 (file)
@@ -34,6 +34,7 @@ $panel_height: 2.2em;
     -panel-corner-radius: $panel_corner_radius;
     -panel-corner-background-color: $panel_bg_color;
     -panel-corner-border-width: 2px;
+    -panel-corner-opacity: 1;
   }
 
   // panel menus
index 5b0eaec43428b661e4f454efaa5b808300134a7a..d0f3aff1fed5e6d5ec23a5b998f70074e3036a8a 100644 (file)
@@ -574,10 +574,6 @@ class PanelCorner extends St.DrawingArea {
                     let pseudoClass = button.get_style_pseudo_class();
                     this.set_style_pseudo_class(pseudoClass);
                 });
-
-            // The corner doesn't support theme transitions, so override
-            // the .panel-button default
-            button.style = 'transition-duration: 0ms';
         }
     }
 
@@ -618,8 +614,18 @@ class PanelCorner extends St.DrawingArea {
         let cornerRadius = node.get_length("-panel-corner-radius");
         let borderWidth = node.get_length('-panel-corner-border-width');
 
+        const transitionDuration = node.get_transition_duration();
+        const opacity = node.get_double('-panel-corner-opacity');
+
         this.set_size(cornerRadius, borderWidth + cornerRadius);
         this.translation_y = -borderWidth;
+
+        this.remove_transition('opacity');
+        this.ease({
+            opacity: opacity * 255,
+            duration: transitionDuration,
+            mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
+        });
     }
 });